<%@ page language="java" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>省市区级联选择</title>
    
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="js/LocalList.js"></script>
	
  </head>
  
  <body>
  <table>
  	<tr>
  		<td>地区：</td>
  		<td>
  			<script type="text/javascript">
				var options = {
					country: "province",		// “省”下拉列表的名称
					state: "city",				// “市”下拉列表的名称
					city: "area",				// “区”下拉列表的名称
					current: "12||04",		// 当前默认值，用管道符“|”分割
					language: "zh_cn",			// 数据文件的语言
					path_to_xml: "js/data/china/",	// 数据文件的目录
					read_only: false			// 数据是否只读，若设置为true，则无需设置 country 和 state
				};
				LocalList.mf_init(options);
				
			</script>
  		</td>
  	</tr>
  </table>
    <script type="text/javascript">
    function takeValue(){
    	//var label = $("#province").find("option:selected").text(); 
    	//alert(label);
    	var indexP = document.getElementById("province").selectedIndex;
    	var indexC = document.getElementById("city").selectedIndex;
    	var indexA = document.getElementById("area").selectedIndex;
    	alert(document.getElementById("province").options[indexP].text);
    	alert(document.getElementById("city").options[indexC].text);
    	alert(document.getElementById("city").value);
    	alert(document.getElementById("area").options[indexA].text);
    	//alert(document.getElementById("ad.city").value);
    	//alert(document.getElementById("ad.area").value);
    	//alert($("#ad.province").val());
    	//alert($("#ad.province").text());
    }
    	
    </script>
	<input type="button" value="Go" onclick="takeValue()">
	<br>
	<br>
  </body>
